{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "6bdb68a4",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "\n",
    "from sklearn.pipeline import Pipeline\n",
    "from sklearn.linear_model import LogisticRegression\n",
    "from sklearn.model_selection import train_test_split\n",
    "from sklearn.metrics import classification_report\n",
    "\n",
    "from tsfresh.transformers import RelevantFeatureAugmenter"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "77e5e5e6",
   "metadata": {},
   "outputs": [],
   "source": [
    "# load data\n",
    "\n",
    "X = pd.read_csv(\"occupancy.csv\", parse_dates=[\"date\"])\n",
    "\n",
    "y = pd.read_csv(\"occupancy_target.csv\", index_col=\"id\")[\"occupancy\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "055cfb13",
   "metadata": {},
   "outputs": [],
   "source": [
    "tmp = pd.DataFrame(index=y.index)\n",
    "\n",
    "# Split data into train and test set\n",
    "X_train, X_test, y_train, y_test = train_test_split(tmp, y, random_state=0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "f4e4f13f",
   "metadata": {},
   "outputs": [],
   "source": [
    "kind_to_fc_parameters = {\n",
    "    \"light\": {\n",
    "        \"c3\": [{\"lag\": 3}, {\"lag\": 2}, {\"lag\": 1}],\n",
    "        \"abs_energy\": None,\n",
    "        \"sum_values\": None,\n",
    "        \"fft_coefficient\": [{\"attr\": \"real\", \"coeff\": 0}, {\"attr\": \"abs\", \"coeff\": 0}],\n",
    "        \"spkt_welch_density\": [{\"coeff\": 2}, {\"coeff\": 5}, {\"coeff\": 8}],\n",
    "        \"agg_linear_trend\": [\n",
    "            {\"attr\": \"intercept\", \"chunk_len\": 50, \"f_agg\": \"var\"},\n",
    "            {\"attr\": \"slope\", \"chunk_len\": 50, \"f_agg\": \"var\"},\n",
    "        ],\n",
    "        \"change_quantiles\": [\n",
    "            {\"f_agg\": \"var\", \"isabs\": False, \"qh\": 1.0, \"ql\": 0.8},\n",
    "            {\"f_agg\": \"var\", \"isabs\": True, \"qh\": 1.0, \"ql\": 0.8},\n",
    "        ],\n",
    "    },\n",
    "    \"co2\": {\n",
    "        \"fft_coefficient\": [{\"attr\": \"real\", \"coeff\": 0}, {\"attr\": \"abs\", \"coeff\": 0}],\n",
    "        \"c3\": [{\"lag\": 3}, {\"lag\": 2}, {\"lag\": 1}],\n",
    "        \"sum_values\": None,\n",
    "        \"abs_energy\": None,\n",
    "        \"sum_of_reoccurring_data_points\": None,\n",
    "        \"sum_of_reoccurring_values\": None,\n",
    "    },\n",
    "    \"temperature\": {\"c3\": [{\"lag\": 1}, {\"lag\": 2}, {\"lag\": 3}], \"abs_energy\": None},\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "4eb27912",
   "metadata": {},
   "outputs": [],
   "source": [
    "augmenter = RelevantFeatureAugmenter(\n",
    "    column_id=\"id\",\n",
    "    column_sort=\"date\",\n",
    "    kind_to_fc_parameters=kind_to_fc_parameters,\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "a5ed5311",
   "metadata": {},
   "outputs": [],
   "source": [
    "pipe = Pipeline(\n",
    "    [\n",
    "        (\"augmenter\", augmenter),\n",
    "        (\"classifier\", LogisticRegression(random_state=10, C=0.01)),\n",
    "    ]\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "7396dd86",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<style>#sk-container-id-1 {\n",
       "  /* Definition of color scheme common for light and dark mode */\n",
       "  --sklearn-color-text: black;\n",
       "  --sklearn-color-line: gray;\n",
       "  /* Definition of color scheme for unfitted estimators */\n",
       "  --sklearn-color-unfitted-level-0: #fff5e6;\n",
       "  --sklearn-color-unfitted-level-1: #f6e4d2;\n",
       "  --sklearn-color-unfitted-level-2: #ffe0b3;\n",
       "  --sklearn-color-unfitted-level-3: chocolate;\n",
       "  /* Definition of color scheme for fitted estimators */\n",
       "  --sklearn-color-fitted-level-0: #f0f8ff;\n",
       "  --sklearn-color-fitted-level-1: #d4ebff;\n",
       "  --sklearn-color-fitted-level-2: #b3dbfd;\n",
       "  --sklearn-color-fitted-level-3: cornflowerblue;\n",
       "\n",
       "  /* Specific color for light theme */\n",
       "  --sklearn-color-text-on-default-background: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, black)));\n",
       "  --sklearn-color-background: var(--sg-background-color, var(--theme-background, var(--jp-layout-color0, white)));\n",
       "  --sklearn-color-border-box: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, black)));\n",
       "  --sklearn-color-icon: #696969;\n",
       "\n",
       "  @media (prefers-color-scheme: dark) {\n",
       "    /* Redefinition of color scheme for dark theme */\n",
       "    --sklearn-color-text-on-default-background: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, white)));\n",
       "    --sklearn-color-background: var(--sg-background-color, var(--theme-background, var(--jp-layout-color0, #111)));\n",
       "    --sklearn-color-border-box: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, white)));\n",
       "    --sklearn-color-icon: #878787;\n",
       "  }\n",
       "}\n",
       "\n",
       "#sk-container-id-1 {\n",
       "  color: var(--sklearn-color-text);\n",
       "}\n",
       "\n",
       "#sk-container-id-1 pre {\n",
       "  padding: 0;\n",
       "}\n",
       "\n",
       "#sk-container-id-1 input.sk-hidden--visually {\n",
       "  border: 0;\n",
       "  clip: rect(1px 1px 1px 1px);\n",
       "  clip: rect(1px, 1px, 1px, 1px);\n",
       "  height: 1px;\n",
       "  margin: -1px;\n",
       "  overflow: hidden;\n",
       "  padding: 0;\n",
       "  position: absolute;\n",
       "  width: 1px;\n",
       "}\n",
       "\n",
       "#sk-container-id-1 div.sk-dashed-wrapped {\n",
       "  border: 1px dashed var(--sklearn-color-line);\n",
       "  margin: 0 0.4em 0.5em 0.4em;\n",
       "  box-sizing: border-box;\n",
       "  padding-bottom: 0.4em;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "}\n",
       "\n",
       "#sk-container-id-1 div.sk-container {\n",
       "  /* jupyter's `normalize.less` sets `[hidden] { display: none; }`\n",
       "     but bootstrap.min.css set `[hidden] { display: none !important; }`\n",
       "     so we also need the `!important` here to be able to override the\n",
       "     default hidden behavior on the sphinx rendered scikit-learn.org.\n",
       "     See: https://github.com/scikit-learn/scikit-learn/issues/21755 */\n",
       "  display: inline-block !important;\n",
       "  position: relative;\n",
       "}\n",
       "\n",
       "#sk-container-id-1 div.sk-text-repr-fallback {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       "div.sk-parallel-item,\n",
       "div.sk-serial,\n",
       "div.sk-item {\n",
       "  /* draw centered vertical line to link estimators */\n",
       "  background-image: linear-gradient(var(--sklearn-color-text-on-default-background), var(--sklearn-color-text-on-default-background));\n",
       "  background-size: 2px 100%;\n",
       "  background-repeat: no-repeat;\n",
       "  background-position: center center;\n",
       "}\n",
       "\n",
       "/* Parallel-specific style estimator block */\n",
       "\n",
       "#sk-container-id-1 div.sk-parallel-item::after {\n",
       "  content: \"\";\n",
       "  width: 100%;\n",
       "  border-bottom: 2px solid var(--sklearn-color-text-on-default-background);\n",
       "  flex-grow: 1;\n",
       "}\n",
       "\n",
       "#sk-container-id-1 div.sk-parallel {\n",
       "  display: flex;\n",
       "  align-items: stretch;\n",
       "  justify-content: center;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  position: relative;\n",
       "}\n",
       "\n",
       "#sk-container-id-1 div.sk-parallel-item {\n",
       "  display: flex;\n",
       "  flex-direction: column;\n",
       "}\n",
       "\n",
       "#sk-container-id-1 div.sk-parallel-item:first-child::after {\n",
       "  align-self: flex-end;\n",
       "  width: 50%;\n",
       "}\n",
       "\n",
       "#sk-container-id-1 div.sk-parallel-item:last-child::after {\n",
       "  align-self: flex-start;\n",
       "  width: 50%;\n",
       "}\n",
       "\n",
       "#sk-container-id-1 div.sk-parallel-item:only-child::after {\n",
       "  width: 0;\n",
       "}\n",
       "\n",
       "/* Serial-specific style estimator block */\n",
       "\n",
       "#sk-container-id-1 div.sk-serial {\n",
       "  display: flex;\n",
       "  flex-direction: column;\n",
       "  align-items: center;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  padding-right: 1em;\n",
       "  padding-left: 1em;\n",
       "}\n",
       "\n",
       "\n",
       "/* Toggleable style: style used for estimator/Pipeline/ColumnTransformer box that is\n",
       "clickable and can be expanded/collapsed.\n",
       "- Pipeline and ColumnTransformer use this feature and define the default style\n",
       "- Estimators will overwrite some part of the style using the `sk-estimator` class\n",
       "*/\n",
       "\n",
       "/* Pipeline and ColumnTransformer style (default) */\n",
       "\n",
       "#sk-container-id-1 div.sk-toggleable {\n",
       "  /* Default theme specific background. It is overwritten whether we have a\n",
       "  specific estimator or a Pipeline/ColumnTransformer */\n",
       "  background-color: var(--sklearn-color-background);\n",
       "}\n",
       "\n",
       "/* Toggleable label */\n",
       "#sk-container-id-1 label.sk-toggleable__label {\n",
       "  cursor: pointer;\n",
       "  display: block;\n",
       "  width: 100%;\n",
       "  margin-bottom: 0;\n",
       "  padding: 0.5em;\n",
       "  box-sizing: border-box;\n",
       "  text-align: center;\n",
       "}\n",
       "\n",
       "#sk-container-id-1 label.sk-toggleable__label-arrow:before {\n",
       "  /* Arrow on the left of the label */\n",
       "  content: \"▸\";\n",
       "  float: left;\n",
       "  margin-right: 0.25em;\n",
       "  color: var(--sklearn-color-icon);\n",
       "}\n",
       "\n",
       "#sk-container-id-1 label.sk-toggleable__label-arrow:hover:before {\n",
       "  color: var(--sklearn-color-text);\n",
       "}\n",
       "\n",
       "/* Toggleable content - dropdown */\n",
       "\n",
       "#sk-container-id-1 div.sk-toggleable__content {\n",
       "  max-height: 0;\n",
       "  max-width: 0;\n",
       "  overflow: hidden;\n",
       "  text-align: left;\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-1 div.sk-toggleable__content.fitted {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-1 div.sk-toggleable__content pre {\n",
       "  margin: 0.2em;\n",
       "  border-radius: 0.25em;\n",
       "  color: var(--sklearn-color-text);\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-1 div.sk-toggleable__content.fitted pre {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-1 input.sk-toggleable__control:checked~div.sk-toggleable__content {\n",
       "  /* Expand drop-down */\n",
       "  max-height: 200px;\n",
       "  max-width: 100%;\n",
       "  overflow: auto;\n",
       "}\n",
       "\n",
       "#sk-container-id-1 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {\n",
       "  content: \"▾\";\n",
       "}\n",
       "\n",
       "/* Pipeline/ColumnTransformer-specific style */\n",
       "\n",
       "#sk-container-id-1 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  color: var(--sklearn-color-text);\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-1 div.sk-label.fitted input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "/* Estimator-specific style */\n",
       "\n",
       "/* Colorize estimator box */\n",
       "#sk-container-id-1 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-1 div.sk-estimator.fitted input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-1 div.sk-label label.sk-toggleable__label,\n",
       "#sk-container-id-1 div.sk-label label {\n",
       "  /* The background is the default theme color */\n",
       "  color: var(--sklearn-color-text-on-default-background);\n",
       "}\n",
       "\n",
       "/* On hover, darken the color of the background */\n",
       "#sk-container-id-1 div.sk-label:hover label.sk-toggleable__label {\n",
       "  color: var(--sklearn-color-text);\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "/* Label box, darken color on hover, fitted */\n",
       "#sk-container-id-1 div.sk-label.fitted:hover label.sk-toggleable__label.fitted {\n",
       "  color: var(--sklearn-color-text);\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "/* Estimator label */\n",
       "\n",
       "#sk-container-id-1 div.sk-label label {\n",
       "  font-family: monospace;\n",
       "  font-weight: bold;\n",
       "  display: inline-block;\n",
       "  line-height: 1.2em;\n",
       "}\n",
       "\n",
       "#sk-container-id-1 div.sk-label-container {\n",
       "  text-align: center;\n",
       "}\n",
       "\n",
       "/* Estimator-specific */\n",
       "#sk-container-id-1 div.sk-estimator {\n",
       "  font-family: monospace;\n",
       "  border: 1px dotted var(--sklearn-color-border-box);\n",
       "  border-radius: 0.25em;\n",
       "  box-sizing: border-box;\n",
       "  margin-bottom: 0.5em;\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-1 div.sk-estimator.fitted {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-0);\n",
       "}\n",
       "\n",
       "/* on hover */\n",
       "#sk-container-id-1 div.sk-estimator:hover {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-1 div.sk-estimator.fitted:hover {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "/* Specification for estimator info (e.g. \"i\" and \"?\") */\n",
       "\n",
       "/* Common style for \"i\" and \"?\" */\n",
       "\n",
       ".sk-estimator-doc-link,\n",
       "a:link.sk-estimator-doc-link,\n",
       "a:visited.sk-estimator-doc-link {\n",
       "  float: right;\n",
       "  font-size: smaller;\n",
       "  line-height: 1em;\n",
       "  font-family: monospace;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  border-radius: 1em;\n",
       "  height: 1em;\n",
       "  width: 1em;\n",
       "  text-decoration: none !important;\n",
       "  margin-left: 1ex;\n",
       "  /* unfitted */\n",
       "  border: var(--sklearn-color-unfitted-level-1) 1pt solid;\n",
       "  color: var(--sklearn-color-unfitted-level-1);\n",
       "}\n",
       "\n",
       ".sk-estimator-doc-link.fitted,\n",
       "a:link.sk-estimator-doc-link.fitted,\n",
       "a:visited.sk-estimator-doc-link.fitted {\n",
       "  /* fitted */\n",
       "  border: var(--sklearn-color-fitted-level-1) 1pt solid;\n",
       "  color: var(--sklearn-color-fitted-level-1);\n",
       "}\n",
       "\n",
       "/* On hover */\n",
       "div.sk-estimator:hover .sk-estimator-doc-link:hover,\n",
       ".sk-estimator-doc-link:hover,\n",
       "div.sk-label-container:hover .sk-estimator-doc-link:hover,\n",
       ".sk-estimator-doc-link:hover {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-3);\n",
       "  color: var(--sklearn-color-background);\n",
       "  text-decoration: none;\n",
       "}\n",
       "\n",
       "div.sk-estimator.fitted:hover .sk-estimator-doc-link.fitted:hover,\n",
       ".sk-estimator-doc-link.fitted:hover,\n",
       "div.sk-label-container:hover .sk-estimator-doc-link.fitted:hover,\n",
       ".sk-estimator-doc-link.fitted:hover {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-3);\n",
       "  color: var(--sklearn-color-background);\n",
       "  text-decoration: none;\n",
       "}\n",
       "\n",
       "/* Span, style for the box shown on hovering the info icon */\n",
       ".sk-estimator-doc-link span {\n",
       "  display: none;\n",
       "  z-index: 9999;\n",
       "  position: relative;\n",
       "  font-weight: normal;\n",
       "  right: .2ex;\n",
       "  padding: .5ex;\n",
       "  margin: .5ex;\n",
       "  width: min-content;\n",
       "  min-width: 20ex;\n",
       "  max-width: 50ex;\n",
       "  color: var(--sklearn-color-text);\n",
       "  box-shadow: 2pt 2pt 4pt #999;\n",
       "  /* unfitted */\n",
       "  background: var(--sklearn-color-unfitted-level-0);\n",
       "  border: .5pt solid var(--sklearn-color-unfitted-level-3);\n",
       "}\n",
       "\n",
       ".sk-estimator-doc-link.fitted span {\n",
       "  /* fitted */\n",
       "  background: var(--sklearn-color-fitted-level-0);\n",
       "  border: var(--sklearn-color-fitted-level-3);\n",
       "}\n",
       "\n",
       ".sk-estimator-doc-link:hover span {\n",
       "  display: block;\n",
       "}\n",
       "\n",
       "/* \"?\"-specific style due to the `<a>` HTML tag */\n",
       "\n",
       "#sk-container-id-1 a.estimator_doc_link {\n",
       "  float: right;\n",
       "  font-size: 1rem;\n",
       "  line-height: 1em;\n",
       "  font-family: monospace;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  border-radius: 1rem;\n",
       "  height: 1rem;\n",
       "  width: 1rem;\n",
       "  text-decoration: none;\n",
       "  /* unfitted */\n",
       "  color: var(--sklearn-color-unfitted-level-1);\n",
       "  border: var(--sklearn-color-unfitted-level-1) 1pt solid;\n",
       "}\n",
       "\n",
       "#sk-container-id-1 a.estimator_doc_link.fitted {\n",
       "  /* fitted */\n",
       "  border: var(--sklearn-color-fitted-level-1) 1pt solid;\n",
       "  color: var(--sklearn-color-fitted-level-1);\n",
       "}\n",
       "\n",
       "/* On hover */\n",
       "#sk-container-id-1 a.estimator_doc_link:hover {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-3);\n",
       "  color: var(--sklearn-color-background);\n",
       "  text-decoration: none;\n",
       "}\n",
       "\n",
       "#sk-container-id-1 a.estimator_doc_link.fitted:hover {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-3);\n",
       "}\n",
       "</style><div id=\"sk-container-id-1\" class=\"sk-top-container\"><div class=\"sk-text-repr-fallback\"><pre>Pipeline(steps=[(&#x27;augmenter&#x27;,\n",
       "                 RelevantFeatureAugmenter(column_id=&#x27;id&#x27;, column_sort=&#x27;date&#x27;,\n",
       "                                          kind_to_fc_parameters={&#x27;co2&#x27;: {&#x27;abs_energy&#x27;: None,\n",
       "                                                                         &#x27;c3&#x27;: [{&#x27;lag&#x27;: 3},\n",
       "                                                                                {&#x27;lag&#x27;: 2},\n",
       "                                                                                {&#x27;lag&#x27;: 1}],\n",
       "                                                                         &#x27;fft_coefficient&#x27;: [{&#x27;attr&#x27;: &#x27;real&#x27;,\n",
       "                                                                                              &#x27;coeff&#x27;: 0},\n",
       "                                                                                             {&#x27;attr&#x27;: &#x27;abs&#x27;,\n",
       "                                                                                              &#x27;coeff&#x27;: 0}],\n",
       "                                                                         &#x27;sum_of_reoccurring_data_points&#x27;: None,\n",
       "                                                                         &#x27;sum_of_reoccurring_values&#x27;: None,\n",
       "                                                                         &#x27;sum_values&#x27;: None},\n",
       "                                                                 &#x27;light&#x27;: {&#x27;abs_en...\n",
       "8097  135 2015-02-10 08:57:00       20.575  33.925000  405.0  516.00   \n",
       "8098  135 2015-02-10 08:57:59       20.600  33.872500  412.0  521.25   \n",
       "8099  135 2015-02-10 08:58:59       20.600  33.895000  419.0  525.75   \n",
       "\n",
       "      humidity_ratio  \n",
       "0           0.004745  \n",
       "1           0.004741  \n",
       "2           0.004739  \n",
       "3           0.004751  \n",
       "4           0.004734  \n",
       "...              ...  \n",
       "8095        0.005060  \n",
       "8096        0.005086  \n",
       "8097        0.005088  \n",
       "8098        0.005088  \n",
       "8099        0.005091  \n",
       "\n",
       "[8100 rows x 7 columns])),\n",
       "                (&#x27;classifier&#x27;, LogisticRegression(C=0.01, random_state=10))])</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class=\"sk-container\" hidden><div class=\"sk-item sk-dashed-wrapped\"><div class=\"sk-label-container\"><div class=\"sk-label  sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-1\" type=\"checkbox\" ><label for=\"sk-estimator-id-1\" class=\"sk-toggleable__label  sk-toggleable__label-arrow \">&nbsp;&nbsp;Pipeline<a class=\"sk-estimator-doc-link \" rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.5/modules/generated/sklearn.pipeline.Pipeline.html\">?<span>Documentation for Pipeline</span></a><span class=\"sk-estimator-doc-link \">i<span>Not fitted</span></span></label><div class=\"sk-toggleable__content \"><pre>Pipeline(steps=[(&#x27;augmenter&#x27;,\n",
       "                 RelevantFeatureAugmenter(column_id=&#x27;id&#x27;, column_sort=&#x27;date&#x27;,\n",
       "                                          kind_to_fc_parameters={&#x27;co2&#x27;: {&#x27;abs_energy&#x27;: None,\n",
       "                                                                         &#x27;c3&#x27;: [{&#x27;lag&#x27;: 3},\n",
       "                                                                                {&#x27;lag&#x27;: 2},\n",
       "                                                                                {&#x27;lag&#x27;: 1}],\n",
       "                                                                         &#x27;fft_coefficient&#x27;: [{&#x27;attr&#x27;: &#x27;real&#x27;,\n",
       "                                                                                              &#x27;coeff&#x27;: 0},\n",
       "                                                                                             {&#x27;attr&#x27;: &#x27;abs&#x27;,\n",
       "                                                                                              &#x27;coeff&#x27;: 0}],\n",
       "                                                                         &#x27;sum_of_reoccurring_data_points&#x27;: None,\n",
       "                                                                         &#x27;sum_of_reoccurring_values&#x27;: None,\n",
       "                                                                         &#x27;sum_values&#x27;: None},\n",
       "                                                                 &#x27;light&#x27;: {&#x27;abs_en...\n",
       "8097  135 2015-02-10 08:57:00       20.575  33.925000  405.0  516.00   \n",
       "8098  135 2015-02-10 08:57:59       20.600  33.872500  412.0  521.25   \n",
       "8099  135 2015-02-10 08:58:59       20.600  33.895000  419.0  525.75   \n",
       "\n",
       "      humidity_ratio  \n",
       "0           0.004745  \n",
       "1           0.004741  \n",
       "2           0.004739  \n",
       "3           0.004751  \n",
       "4           0.004734  \n",
       "...              ...  \n",
       "8095        0.005060  \n",
       "8096        0.005086  \n",
       "8097        0.005088  \n",
       "8098        0.005088  \n",
       "8099        0.005091  \n",
       "\n",
       "[8100 rows x 7 columns])),\n",
       "                (&#x27;classifier&#x27;, LogisticRegression(C=0.01, random_state=10))])</pre></div> </div></div><div class=\"sk-serial\"><div class=\"sk-item\"><div class=\"sk-estimator  sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-2\" type=\"checkbox\" ><label for=\"sk-estimator-id-2\" class=\"sk-toggleable__label  sk-toggleable__label-arrow \">RelevantFeatureAugmenter</label><div class=\"sk-toggleable__content \"><pre>RelevantFeatureAugmenter(column_id=&#x27;id&#x27;, column_sort=&#x27;date&#x27;,\n",
       "                         kind_to_fc_parameters={&#x27;co2&#x27;: {&#x27;abs_energy&#x27;: None,\n",
       "                                                        &#x27;c3&#x27;: [{&#x27;lag&#x27;: 3},\n",
       "                                                               {&#x27;lag&#x27;: 2},\n",
       "                                                               {&#x27;lag&#x27;: 1}],\n",
       "                                                        &#x27;fft_coefficient&#x27;: [{&#x27;attr&#x27;: &#x27;real&#x27;,\n",
       "                                                                             &#x27;coeff&#x27;: 0},\n",
       "                                                                            {&#x27;attr&#x27;: &#x27;abs&#x27;,\n",
       "                                                                             &#x27;coeff&#x27;: 0}],\n",
       "                                                        &#x27;sum_of_reoccurring_data_points&#x27;: None,\n",
       "                                                        &#x27;sum_of_reoccurring_values&#x27;: None,\n",
       "                                                        &#x27;sum_values&#x27;: None},\n",
       "                                                &#x27;light&#x27;: {&#x27;abs_energy&#x27;: None,\n",
       "                                                          &#x27;agg_linear_trend&#x27;...\n",
       "8095  135 2015-02-10 08:55:00       20.550  33.790000  405.0  508.00   \n",
       "8096  135 2015-02-10 08:55:59       20.600  33.863333  405.0  509.50   \n",
       "8097  135 2015-02-10 08:57:00       20.575  33.925000  405.0  516.00   \n",
       "8098  135 2015-02-10 08:57:59       20.600  33.872500  412.0  521.25   \n",
       "8099  135 2015-02-10 08:58:59       20.600  33.895000  419.0  525.75   \n",
       "\n",
       "      humidity_ratio  \n",
       "0           0.004745  \n",
       "1           0.004741  \n",
       "2           0.004739  \n",
       "3           0.004751  \n",
       "4           0.004734  \n",
       "...              ...  \n",
       "8095        0.005060  \n",
       "8096        0.005086  \n",
       "8097        0.005088  \n",
       "8098        0.005088  \n",
       "8099        0.005091  \n",
       "\n",
       "[8100 rows x 7 columns])</pre></div> </div></div><div class=\"sk-item\"><div class=\"sk-estimator  sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-3\" type=\"checkbox\" ><label for=\"sk-estimator-id-3\" class=\"sk-toggleable__label  sk-toggleable__label-arrow \">&nbsp;LogisticRegression<a class=\"sk-estimator-doc-link \" rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.5/modules/generated/sklearn.linear_model.LogisticRegression.html\">?<span>Documentation for LogisticRegression</span></a></label><div class=\"sk-toggleable__content \"><pre>LogisticRegression(C=0.01, random_state=10)</pre></div> </div></div></div></div></div></div>"
      ],
      "text/plain": [
       "Pipeline(steps=[('augmenter',\n",
       "                 RelevantFeatureAugmenter(column_id='id', column_sort='date',\n",
       "                                          kind_to_fc_parameters={'co2': {'abs_energy': None,\n",
       "                                                                         'c3': [{'lag': 3},\n",
       "                                                                                {'lag': 2},\n",
       "                                                                                {'lag': 1}],\n",
       "                                                                         'fft_coefficient': [{'attr': 'real',\n",
       "                                                                                              'coeff': 0},\n",
       "                                                                                             {'attr': 'abs',\n",
       "                                                                                              'coeff': 0}],\n",
       "                                                                         'sum_of_reoccurring_data_points': None,\n",
       "                                                                         'sum_of_reoccurring_values': None,\n",
       "                                                                         'sum_values': None},\n",
       "                                                                 'light': {'abs_en...\n",
       "8097  135 2015-02-10 08:57:00       20.575  33.925000  405.0  516.00   \n",
       "8098  135 2015-02-10 08:57:59       20.600  33.872500  412.0  521.25   \n",
       "8099  135 2015-02-10 08:58:59       20.600  33.895000  419.0  525.75   \n",
       "\n",
       "      humidity_ratio  \n",
       "0           0.004745  \n",
       "1           0.004741  \n",
       "2           0.004739  \n",
       "3           0.004751  \n",
       "4           0.004734  \n",
       "...              ...  \n",
       "8095        0.005060  \n",
       "8096        0.005086  \n",
       "8097        0.005088  \n",
       "8098        0.005088  \n",
       "8099        0.005091  \n",
       "\n",
       "[8100 rows x 7 columns])),\n",
       "                ('classifier', LogisticRegression(C=0.01, random_state=10))])"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pipe.set_params(augmenter__timeseries_container=X)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "ccbb4eb4",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Feature Extraction: 100%|██████████████████████████████████████████████████████████████| 10/10 [00:04<00:00,  2.04it/s]\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<style>#sk-container-id-2 {\n",
       "  /* Definition of color scheme common for light and dark mode */\n",
       "  --sklearn-color-text: black;\n",
       "  --sklearn-color-line: gray;\n",
       "  /* Definition of color scheme for unfitted estimators */\n",
       "  --sklearn-color-unfitted-level-0: #fff5e6;\n",
       "  --sklearn-color-unfitted-level-1: #f6e4d2;\n",
       "  --sklearn-color-unfitted-level-2: #ffe0b3;\n",
       "  --sklearn-color-unfitted-level-3: chocolate;\n",
       "  /* Definition of color scheme for fitted estimators */\n",
       "  --sklearn-color-fitted-level-0: #f0f8ff;\n",
       "  --sklearn-color-fitted-level-1: #d4ebff;\n",
       "  --sklearn-color-fitted-level-2: #b3dbfd;\n",
       "  --sklearn-color-fitted-level-3: cornflowerblue;\n",
       "\n",
       "  /* Specific color for light theme */\n",
       "  --sklearn-color-text-on-default-background: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, black)));\n",
       "  --sklearn-color-background: var(--sg-background-color, var(--theme-background, var(--jp-layout-color0, white)));\n",
       "  --sklearn-color-border-box: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, black)));\n",
       "  --sklearn-color-icon: #696969;\n",
       "\n",
       "  @media (prefers-color-scheme: dark) {\n",
       "    /* Redefinition of color scheme for dark theme */\n",
       "    --sklearn-color-text-on-default-background: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, white)));\n",
       "    --sklearn-color-background: var(--sg-background-color, var(--theme-background, var(--jp-layout-color0, #111)));\n",
       "    --sklearn-color-border-box: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, white)));\n",
       "    --sklearn-color-icon: #878787;\n",
       "  }\n",
       "}\n",
       "\n",
       "#sk-container-id-2 {\n",
       "  color: var(--sklearn-color-text);\n",
       "}\n",
       "\n",
       "#sk-container-id-2 pre {\n",
       "  padding: 0;\n",
       "}\n",
       "\n",
       "#sk-container-id-2 input.sk-hidden--visually {\n",
       "  border: 0;\n",
       "  clip: rect(1px 1px 1px 1px);\n",
       "  clip: rect(1px, 1px, 1px, 1px);\n",
       "  height: 1px;\n",
       "  margin: -1px;\n",
       "  overflow: hidden;\n",
       "  padding: 0;\n",
       "  position: absolute;\n",
       "  width: 1px;\n",
       "}\n",
       "\n",
       "#sk-container-id-2 div.sk-dashed-wrapped {\n",
       "  border: 1px dashed var(--sklearn-color-line);\n",
       "  margin: 0 0.4em 0.5em 0.4em;\n",
       "  box-sizing: border-box;\n",
       "  padding-bottom: 0.4em;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "}\n",
       "\n",
       "#sk-container-id-2 div.sk-container {\n",
       "  /* jupyter's `normalize.less` sets `[hidden] { display: none; }`\n",
       "     but bootstrap.min.css set `[hidden] { display: none !important; }`\n",
       "     so we also need the `!important` here to be able to override the\n",
       "     default hidden behavior on the sphinx rendered scikit-learn.org.\n",
       "     See: https://github.com/scikit-learn/scikit-learn/issues/21755 */\n",
       "  display: inline-block !important;\n",
       "  position: relative;\n",
       "}\n",
       "\n",
       "#sk-container-id-2 div.sk-text-repr-fallback {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       "div.sk-parallel-item,\n",
       "div.sk-serial,\n",
       "div.sk-item {\n",
       "  /* draw centered vertical line to link estimators */\n",
       "  background-image: linear-gradient(var(--sklearn-color-text-on-default-background), var(--sklearn-color-text-on-default-background));\n",
       "  background-size: 2px 100%;\n",
       "  background-repeat: no-repeat;\n",
       "  background-position: center center;\n",
       "}\n",
       "\n",
       "/* Parallel-specific style estimator block */\n",
       "\n",
       "#sk-container-id-2 div.sk-parallel-item::after {\n",
       "  content: \"\";\n",
       "  width: 100%;\n",
       "  border-bottom: 2px solid var(--sklearn-color-text-on-default-background);\n",
       "  flex-grow: 1;\n",
       "}\n",
       "\n",
       "#sk-container-id-2 div.sk-parallel {\n",
       "  display: flex;\n",
       "  align-items: stretch;\n",
       "  justify-content: center;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  position: relative;\n",
       "}\n",
       "\n",
       "#sk-container-id-2 div.sk-parallel-item {\n",
       "  display: flex;\n",
       "  flex-direction: column;\n",
       "}\n",
       "\n",
       "#sk-container-id-2 div.sk-parallel-item:first-child::after {\n",
       "  align-self: flex-end;\n",
       "  width: 50%;\n",
       "}\n",
       "\n",
       "#sk-container-id-2 div.sk-parallel-item:last-child::after {\n",
       "  align-self: flex-start;\n",
       "  width: 50%;\n",
       "}\n",
       "\n",
       "#sk-container-id-2 div.sk-parallel-item:only-child::after {\n",
       "  width: 0;\n",
       "}\n",
       "\n",
       "/* Serial-specific style estimator block */\n",
       "\n",
       "#sk-container-id-2 div.sk-serial {\n",
       "  display: flex;\n",
       "  flex-direction: column;\n",
       "  align-items: center;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  padding-right: 1em;\n",
       "  padding-left: 1em;\n",
       "}\n",
       "\n",
       "\n",
       "/* Toggleable style: style used for estimator/Pipeline/ColumnTransformer box that is\n",
       "clickable and can be expanded/collapsed.\n",
       "- Pipeline and ColumnTransformer use this feature and define the default style\n",
       "- Estimators will overwrite some part of the style using the `sk-estimator` class\n",
       "*/\n",
       "\n",
       "/* Pipeline and ColumnTransformer style (default) */\n",
       "\n",
       "#sk-container-id-2 div.sk-toggleable {\n",
       "  /* Default theme specific background. It is overwritten whether we have a\n",
       "  specific estimator or a Pipeline/ColumnTransformer */\n",
       "  background-color: var(--sklearn-color-background);\n",
       "}\n",
       "\n",
       "/* Toggleable label */\n",
       "#sk-container-id-2 label.sk-toggleable__label {\n",
       "  cursor: pointer;\n",
       "  display: block;\n",
       "  width: 100%;\n",
       "  margin-bottom: 0;\n",
       "  padding: 0.5em;\n",
       "  box-sizing: border-box;\n",
       "  text-align: center;\n",
       "}\n",
       "\n",
       "#sk-container-id-2 label.sk-toggleable__label-arrow:before {\n",
       "  /* Arrow on the left of the label */\n",
       "  content: \"▸\";\n",
       "  float: left;\n",
       "  margin-right: 0.25em;\n",
       "  color: var(--sklearn-color-icon);\n",
       "}\n",
       "\n",
       "#sk-container-id-2 label.sk-toggleable__label-arrow:hover:before {\n",
       "  color: var(--sklearn-color-text);\n",
       "}\n",
       "\n",
       "/* Toggleable content - dropdown */\n",
       "\n",
       "#sk-container-id-2 div.sk-toggleable__content {\n",
       "  max-height: 0;\n",
       "  max-width: 0;\n",
       "  overflow: hidden;\n",
       "  text-align: left;\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-2 div.sk-toggleable__content.fitted {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-2 div.sk-toggleable__content pre {\n",
       "  margin: 0.2em;\n",
       "  border-radius: 0.25em;\n",
       "  color: var(--sklearn-color-text);\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-2 div.sk-toggleable__content.fitted pre {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-2 input.sk-toggleable__control:checked~div.sk-toggleable__content {\n",
       "  /* Expand drop-down */\n",
       "  max-height: 200px;\n",
       "  max-width: 100%;\n",
       "  overflow: auto;\n",
       "}\n",
       "\n",
       "#sk-container-id-2 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {\n",
       "  content: \"▾\";\n",
       "}\n",
       "\n",
       "/* Pipeline/ColumnTransformer-specific style */\n",
       "\n",
       "#sk-container-id-2 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  color: var(--sklearn-color-text);\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-2 div.sk-label.fitted input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "/* Estimator-specific style */\n",
       "\n",
       "/* Colorize estimator box */\n",
       "#sk-container-id-2 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-2 div.sk-estimator.fitted input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-2 div.sk-label label.sk-toggleable__label,\n",
       "#sk-container-id-2 div.sk-label label {\n",
       "  /* The background is the default theme color */\n",
       "  color: var(--sklearn-color-text-on-default-background);\n",
       "}\n",
       "\n",
       "/* On hover, darken the color of the background */\n",
       "#sk-container-id-2 div.sk-label:hover label.sk-toggleable__label {\n",
       "  color: var(--sklearn-color-text);\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "/* Label box, darken color on hover, fitted */\n",
       "#sk-container-id-2 div.sk-label.fitted:hover label.sk-toggleable__label.fitted {\n",
       "  color: var(--sklearn-color-text);\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "/* Estimator label */\n",
       "\n",
       "#sk-container-id-2 div.sk-label label {\n",
       "  font-family: monospace;\n",
       "  font-weight: bold;\n",
       "  display: inline-block;\n",
       "  line-height: 1.2em;\n",
       "}\n",
       "\n",
       "#sk-container-id-2 div.sk-label-container {\n",
       "  text-align: center;\n",
       "}\n",
       "\n",
       "/* Estimator-specific */\n",
       "#sk-container-id-2 div.sk-estimator {\n",
       "  font-family: monospace;\n",
       "  border: 1px dotted var(--sklearn-color-border-box);\n",
       "  border-radius: 0.25em;\n",
       "  box-sizing: border-box;\n",
       "  margin-bottom: 0.5em;\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-2 div.sk-estimator.fitted {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-0);\n",
       "}\n",
       "\n",
       "/* on hover */\n",
       "#sk-container-id-2 div.sk-estimator:hover {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-2 div.sk-estimator.fitted:hover {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "/* Specification for estimator info (e.g. \"i\" and \"?\") */\n",
       "\n",
       "/* Common style for \"i\" and \"?\" */\n",
       "\n",
       ".sk-estimator-doc-link,\n",
       "a:link.sk-estimator-doc-link,\n",
       "a:visited.sk-estimator-doc-link {\n",
       "  float: right;\n",
       "  font-size: smaller;\n",
       "  line-height: 1em;\n",
       "  font-family: monospace;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  border-radius: 1em;\n",
       "  height: 1em;\n",
       "  width: 1em;\n",
       "  text-decoration: none !important;\n",
       "  margin-left: 1ex;\n",
       "  /* unfitted */\n",
       "  border: var(--sklearn-color-unfitted-level-1) 1pt solid;\n",
       "  color: var(--sklearn-color-unfitted-level-1);\n",
       "}\n",
       "\n",
       ".sk-estimator-doc-link.fitted,\n",
       "a:link.sk-estimator-doc-link.fitted,\n",
       "a:visited.sk-estimator-doc-link.fitted {\n",
       "  /* fitted */\n",
       "  border: var(--sklearn-color-fitted-level-1) 1pt solid;\n",
       "  color: var(--sklearn-color-fitted-level-1);\n",
       "}\n",
       "\n",
       "/* On hover */\n",
       "div.sk-estimator:hover .sk-estimator-doc-link:hover,\n",
       ".sk-estimator-doc-link:hover,\n",
       "div.sk-label-container:hover .sk-estimator-doc-link:hover,\n",
       ".sk-estimator-doc-link:hover {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-3);\n",
       "  color: var(--sklearn-color-background);\n",
       "  text-decoration: none;\n",
       "}\n",
       "\n",
       "div.sk-estimator.fitted:hover .sk-estimator-doc-link.fitted:hover,\n",
       ".sk-estimator-doc-link.fitted:hover,\n",
       "div.sk-label-container:hover .sk-estimator-doc-link.fitted:hover,\n",
       ".sk-estimator-doc-link.fitted:hover {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-3);\n",
       "  color: var(--sklearn-color-background);\n",
       "  text-decoration: none;\n",
       "}\n",
       "\n",
       "/* Span, style for the box shown on hovering the info icon */\n",
       ".sk-estimator-doc-link span {\n",
       "  display: none;\n",
       "  z-index: 9999;\n",
       "  position: relative;\n",
       "  font-weight: normal;\n",
       "  right: .2ex;\n",
       "  padding: .5ex;\n",
       "  margin: .5ex;\n",
       "  width: min-content;\n",
       "  min-width: 20ex;\n",
       "  max-width: 50ex;\n",
       "  color: var(--sklearn-color-text);\n",
       "  box-shadow: 2pt 2pt 4pt #999;\n",
       "  /* unfitted */\n",
       "  background: var(--sklearn-color-unfitted-level-0);\n",
       "  border: .5pt solid var(--sklearn-color-unfitted-level-3);\n",
       "}\n",
       "\n",
       ".sk-estimator-doc-link.fitted span {\n",
       "  /* fitted */\n",
       "  background: var(--sklearn-color-fitted-level-0);\n",
       "  border: var(--sklearn-color-fitted-level-3);\n",
       "}\n",
       "\n",
       ".sk-estimator-doc-link:hover span {\n",
       "  display: block;\n",
       "}\n",
       "\n",
       "/* \"?\"-specific style due to the `<a>` HTML tag */\n",
       "\n",
       "#sk-container-id-2 a.estimator_doc_link {\n",
       "  float: right;\n",
       "  font-size: 1rem;\n",
       "  line-height: 1em;\n",
       "  font-family: monospace;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  border-radius: 1rem;\n",
       "  height: 1rem;\n",
       "  width: 1rem;\n",
       "  text-decoration: none;\n",
       "  /* unfitted */\n",
       "  color: var(--sklearn-color-unfitted-level-1);\n",
       "  border: var(--sklearn-color-unfitted-level-1) 1pt solid;\n",
       "}\n",
       "\n",
       "#sk-container-id-2 a.estimator_doc_link.fitted {\n",
       "  /* fitted */\n",
       "  border: var(--sklearn-color-fitted-level-1) 1pt solid;\n",
       "  color: var(--sklearn-color-fitted-level-1);\n",
       "}\n",
       "\n",
       "/* On hover */\n",
       "#sk-container-id-2 a.estimator_doc_link:hover {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-3);\n",
       "  color: var(--sklearn-color-background);\n",
       "  text-decoration: none;\n",
       "}\n",
       "\n",
       "#sk-container-id-2 a.estimator_doc_link.fitted:hover {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-3);\n",
       "}\n",
       "</style><div id=\"sk-container-id-2\" class=\"sk-top-container\"><div class=\"sk-text-repr-fallback\"><pre>Pipeline(steps=[(&#x27;augmenter&#x27;,\n",
       "                 RelevantFeatureAugmenter(column_id=&#x27;id&#x27;, column_sort=&#x27;date&#x27;,\n",
       "                                          kind_to_fc_parameters={&#x27;co2&#x27;: {&#x27;abs_energy&#x27;: None,\n",
       "                                                                         &#x27;c3&#x27;: [{&#x27;lag&#x27;: 3},\n",
       "                                                                                {&#x27;lag&#x27;: 2},\n",
       "                                                                                {&#x27;lag&#x27;: 1}],\n",
       "                                                                         &#x27;fft_coefficient&#x27;: [{&#x27;attr&#x27;: &#x27;real&#x27;,\n",
       "                                                                                              &#x27;coeff&#x27;: 0},\n",
       "                                                                                             {&#x27;attr&#x27;: &#x27;abs&#x27;,\n",
       "                                                                                              &#x27;coeff&#x27;: 0}],\n",
       "                                                                         &#x27;sum_of_reoccurring_data_points&#x27;: None,\n",
       "                                                                         &#x27;sum_of_reoccurring_values&#x27;: None,\n",
       "                                                                         &#x27;sum_values&#x27;: None},\n",
       "                                                                 &#x27;light&#x27;: {&#x27;abs_en...\n",
       "8097  135 2015-02-10 08:57:00       20.575  33.925000  405.0  516.00   \n",
       "8098  135 2015-02-10 08:57:59       20.600  33.872500  412.0  521.25   \n",
       "8099  135 2015-02-10 08:58:59       20.600  33.895000  419.0  525.75   \n",
       "\n",
       "      humidity_ratio  \n",
       "0           0.004745  \n",
       "1           0.004741  \n",
       "2           0.004739  \n",
       "3           0.004751  \n",
       "4           0.004734  \n",
       "...              ...  \n",
       "8095        0.005060  \n",
       "8096        0.005086  \n",
       "8097        0.005088  \n",
       "8098        0.005088  \n",
       "8099        0.005091  \n",
       "\n",
       "[8100 rows x 7 columns])),\n",
       "                (&#x27;classifier&#x27;, LogisticRegression(C=0.01, random_state=10))])</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class=\"sk-container\" hidden><div class=\"sk-item sk-dashed-wrapped\"><div class=\"sk-label-container\"><div class=\"sk-label fitted sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-4\" type=\"checkbox\" ><label for=\"sk-estimator-id-4\" class=\"sk-toggleable__label fitted sk-toggleable__label-arrow fitted\">&nbsp;&nbsp;Pipeline<a class=\"sk-estimator-doc-link fitted\" rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.5/modules/generated/sklearn.pipeline.Pipeline.html\">?<span>Documentation for Pipeline</span></a><span class=\"sk-estimator-doc-link fitted\">i<span>Fitted</span></span></label><div class=\"sk-toggleable__content fitted\"><pre>Pipeline(steps=[(&#x27;augmenter&#x27;,\n",
       "                 RelevantFeatureAugmenter(column_id=&#x27;id&#x27;, column_sort=&#x27;date&#x27;,\n",
       "                                          kind_to_fc_parameters={&#x27;co2&#x27;: {&#x27;abs_energy&#x27;: None,\n",
       "                                                                         &#x27;c3&#x27;: [{&#x27;lag&#x27;: 3},\n",
       "                                                                                {&#x27;lag&#x27;: 2},\n",
       "                                                                                {&#x27;lag&#x27;: 1}],\n",
       "                                                                         &#x27;fft_coefficient&#x27;: [{&#x27;attr&#x27;: &#x27;real&#x27;,\n",
       "                                                                                              &#x27;coeff&#x27;: 0},\n",
       "                                                                                             {&#x27;attr&#x27;: &#x27;abs&#x27;,\n",
       "                                                                                              &#x27;coeff&#x27;: 0}],\n",
       "                                                                         &#x27;sum_of_reoccurring_data_points&#x27;: None,\n",
       "                                                                         &#x27;sum_of_reoccurring_values&#x27;: None,\n",
       "                                                                         &#x27;sum_values&#x27;: None},\n",
       "                                                                 &#x27;light&#x27;: {&#x27;abs_en...\n",
       "8097  135 2015-02-10 08:57:00       20.575  33.925000  405.0  516.00   \n",
       "8098  135 2015-02-10 08:57:59       20.600  33.872500  412.0  521.25   \n",
       "8099  135 2015-02-10 08:58:59       20.600  33.895000  419.0  525.75   \n",
       "\n",
       "      humidity_ratio  \n",
       "0           0.004745  \n",
       "1           0.004741  \n",
       "2           0.004739  \n",
       "3           0.004751  \n",
       "4           0.004734  \n",
       "...              ...  \n",
       "8095        0.005060  \n",
       "8096        0.005086  \n",
       "8097        0.005088  \n",
       "8098        0.005088  \n",
       "8099        0.005091  \n",
       "\n",
       "[8100 rows x 7 columns])),\n",
       "                (&#x27;classifier&#x27;, LogisticRegression(C=0.01, random_state=10))])</pre></div> </div></div><div class=\"sk-serial\"><div class=\"sk-item\"><div class=\"sk-estimator fitted sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-5\" type=\"checkbox\" ><label for=\"sk-estimator-id-5\" class=\"sk-toggleable__label fitted sk-toggleable__label-arrow fitted\">RelevantFeatureAugmenter</label><div class=\"sk-toggleable__content fitted\"><pre>RelevantFeatureAugmenter(column_id=&#x27;id&#x27;, column_sort=&#x27;date&#x27;,\n",
       "                         kind_to_fc_parameters={&#x27;co2&#x27;: {&#x27;abs_energy&#x27;: None,\n",
       "                                                        &#x27;c3&#x27;: [{&#x27;lag&#x27;: 3},\n",
       "                                                               {&#x27;lag&#x27;: 2},\n",
       "                                                               {&#x27;lag&#x27;: 1}],\n",
       "                                                        &#x27;fft_coefficient&#x27;: [{&#x27;attr&#x27;: &#x27;real&#x27;,\n",
       "                                                                             &#x27;coeff&#x27;: 0},\n",
       "                                                                            {&#x27;attr&#x27;: &#x27;abs&#x27;,\n",
       "                                                                             &#x27;coeff&#x27;: 0}],\n",
       "                                                        &#x27;sum_of_reoccurring_data_points&#x27;: None,\n",
       "                                                        &#x27;sum_of_reoccurring_values&#x27;: None,\n",
       "                                                        &#x27;sum_values&#x27;: None},\n",
       "                                                &#x27;light&#x27;: {&#x27;abs_energy&#x27;: None,\n",
       "                                                          &#x27;agg_linear_trend&#x27;...\n",
       "8095  135 2015-02-10 08:55:00       20.550  33.790000  405.0  508.00   \n",
       "8096  135 2015-02-10 08:55:59       20.600  33.863333  405.0  509.50   \n",
       "8097  135 2015-02-10 08:57:00       20.575  33.925000  405.0  516.00   \n",
       "8098  135 2015-02-10 08:57:59       20.600  33.872500  412.0  521.25   \n",
       "8099  135 2015-02-10 08:58:59       20.600  33.895000  419.0  525.75   \n",
       "\n",
       "      humidity_ratio  \n",
       "0           0.004745  \n",
       "1           0.004741  \n",
       "2           0.004739  \n",
       "3           0.004751  \n",
       "4           0.004734  \n",
       "...              ...  \n",
       "8095        0.005060  \n",
       "8096        0.005086  \n",
       "8097        0.005088  \n",
       "8098        0.005088  \n",
       "8099        0.005091  \n",
       "\n",
       "[8100 rows x 7 columns])</pre></div> </div></div><div class=\"sk-item\"><div class=\"sk-estimator fitted sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-6\" type=\"checkbox\" ><label for=\"sk-estimator-id-6\" class=\"sk-toggleable__label fitted sk-toggleable__label-arrow fitted\">&nbsp;LogisticRegression<a class=\"sk-estimator-doc-link fitted\" rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.5/modules/generated/sklearn.linear_model.LogisticRegression.html\">?<span>Documentation for LogisticRegression</span></a></label><div class=\"sk-toggleable__content fitted\"><pre>LogisticRegression(C=0.01, random_state=10)</pre></div> </div></div></div></div></div></div>"
      ],
      "text/plain": [
       "Pipeline(steps=[('augmenter',\n",
       "                 RelevantFeatureAugmenter(column_id='id', column_sort='date',\n",
       "                                          kind_to_fc_parameters={'co2': {'abs_energy': None,\n",
       "                                                                         'c3': [{'lag': 3},\n",
       "                                                                                {'lag': 2},\n",
       "                                                                                {'lag': 1}],\n",
       "                                                                         'fft_coefficient': [{'attr': 'real',\n",
       "                                                                                              'coeff': 0},\n",
       "                                                                                             {'attr': 'abs',\n",
       "                                                                                              'coeff': 0}],\n",
       "                                                                         'sum_of_reoccurring_data_points': None,\n",
       "                                                                         'sum_of_reoccurring_values': None,\n",
       "                                                                         'sum_values': None},\n",
       "                                                                 'light': {'abs_en...\n",
       "8097  135 2015-02-10 08:57:00       20.575  33.925000  405.0  516.00   \n",
       "8098  135 2015-02-10 08:57:59       20.600  33.872500  412.0  521.25   \n",
       "8099  135 2015-02-10 08:58:59       20.600  33.895000  419.0  525.75   \n",
       "\n",
       "      humidity_ratio  \n",
       "0           0.004745  \n",
       "1           0.004741  \n",
       "2           0.004739  \n",
       "3           0.004751  \n",
       "4           0.004734  \n",
       "...              ...  \n",
       "8095        0.005060  \n",
       "8096        0.005086  \n",
       "8097        0.005088  \n",
       "8098        0.005088  \n",
       "8099        0.005091  \n",
       "\n",
       "[8100 rows x 7 columns])),\n",
       "                ('classifier', LogisticRegression(C=0.01, random_state=10))])"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pipe.fit(X_train, y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "d38aeb9b",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Feature Extraction: 100%|██████████████████████████████████████████████████████████████| 10/10 [00:04<00:00,  2.08it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "              precision    recall  f1-score   support\n",
      "\n",
      "           0       1.00      0.96      0.98        28\n",
      "           1       0.86      1.00      0.92         6\n",
      "\n",
      "    accuracy                           0.97        34\n",
      "   macro avg       0.93      0.98      0.95        34\n",
      "weighted avg       0.97      0.97      0.97        34\n",
      "\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n"
     ]
    }
   ],
   "source": [
    "print(classification_report(y_test, pipe.predict(X_test)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "cae5efb1",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Feature Extraction: 100%|██████████████████████████████████████████████████████████████| 10/10 [00:05<00:00,  1.95it/s]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "(101, 27)"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_t = pipe[:-1].transform(X_train)\n",
    "\n",
    "train_t.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "fd7c0814",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "fsml",
   "language": "python",
   "name": "fsml"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.5"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
